//
//  NSData+Receipt.m
//  lxd
//
//  Created by 陈晨昕 on 16/9/2.
//  Copyright © 2016年 陈晨昕. All rights reserved.
//

#import "NSData+Receipt.h"

@implementation NSData (Receipt)

- (NSDictionary *)dictionaryFromPlistData:(NSError **)outError {
    NSError *error;
    NSDictionary *dictionaryParsed = [NSPropertyListSerialization propertyListWithData:self
                                                                               options:NSPropertyListImmutable
                                                                                format:nil
                                                                                 error:&error];
    
    if (!dictionaryParsed) {
        
        if (error) {
            *outError = error;
        }
        
        return nil;
    }
    
    return dictionaryParsed;
}

@end
